package com.CGFrame.struts.bean;

import java.util.Date;
import java.util.GregorianCalendar;

public class DemoBean{
	private String id;
	private String name;
	private Date date;
	private Integer age;
	
	public static DemoBean[] getBeans(){
		Date date1=new GregorianCalendar(2008,1,1).getTime();
		Date date2=new GregorianCalendar(2008,2,2).getTime();
		Date date3=new GregorianCalendar(2008,3,3).getTime();
		DemoBean[] beans=new DemoBean[]{new DemoBean("1","Tom",date1,20),new DemoBean("2","Jerry",date2,30),new DemoBean("3","Jane",date3,40)};
		return beans;
	}
	
	public DemoBean(){}
	
	public DemoBean(String id,String name,Date date,int age){
		this.id=id;
		this.name=name;
		this.date=date;
		this.age=age;
	}

	@Override
	public String toString() {
		StringBuffer sb=new StringBuffer();
		sb.append("id:").append(this.id).append(" ").append("name:").append(this.name).append(" ")
		.append("date:").append(this.date.getTime()).append(" ").append("age:").append(this.age);
		return sb.toString();
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
}
